<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: ThinJS</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: ThinJS</h1>

    




<section>

<header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>ThinJS<span class="signature">()</span><span class="type-signature"></span></h2>
        
            <div class="class-description">ThinJS类</div>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    
    <h2>Constructor</h2>
    

    
    <h4 class="name" id="ThinJS"><span class="type-signature"></span>new ThinJS<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    ThinJS类
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line27">line 27</a>
    </li></ul></dd>
    

    

    

    
</dl>




















    
    </div>

    

    

    

    

    

    

    
        <h3 class="subsection-title">Members</h3>

        
            
<h4 class="name" id="length"><span class="type-signature"></span>length<span class="type-signature"></span></h4>




<div class="description">
    返回匹配元素的数量。
</div>







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line158">line 158</a>
    </li></ul></dd>
    

    

    

    
</dl>





    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").length;</code></pre>



        
            
<h4 class="name" id="version"><span class="type-signature"></span>version<span class="type-signature"></span></h4>




<div class="description">
    返回当前ThinJS库版本。
</div>







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line148">line 148</a>
    </li></ul></dd>
    

    

    

    
</dl>





    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs().version;</code></pre>



        
    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id=".main"><span class="type-signature">(static) </span>main<span class="signature">(selector, data<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ThinJS.html">ThinJS</a>}</span></h4>
    

    



<div class="description">
    ThinJS类的实例化方法。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>selector</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">NodeList</span>
|

<span class="param-type">HTMLDocument</span>
|

<span class="param-type">Window</span>
|

<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">必须，元素选择器。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>data</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，定义模板数据对象。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line125">line 125</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="ThinJS.html">ThinJS</a></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="addAttr"><span class="type-signature"></span>addAttr<span class="signature">(attr)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    被选元素设置一个或多个指定的属性。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>attr</code></td>
            

            <td class="type">
            
                
<span class="param-type">array</span>


            
            </td>

            

            

            <td class="description last">必须，属性键值对数组。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line889">line 889</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").addAttr([{"id":"#myDiv"}, {"class":"active"}]);</code></pre>



        
            

    

    
    <h4 class="name" id="addClass"><span class="type-signature"></span>addClass<span class="signature">(className)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    为选取元素添加指定class。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>className</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，class名称。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line587">line 587</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").addClass(".active");</code></pre>



        
            

    

    
    <h4 class="name" id="after"><span class="type-signature"></span>after<span class="signature">(str)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    向被选元素的后面添加内容。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>str</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，需要添加的内容。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line324">line 324</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").after("This is the content added through after.");</code></pre>



        
            

    

    
    <h4 class="name" id="ajax"><span class="type-signature"></span>ajax<span class="signature">(settings)</span><span class="type-signature"> &rarr; {<a href="AJAX.html">AJAX</a>}</span></h4>
    

    



<div class="description">
    AJAX类实例调用方法。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>settings</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">AJAX请求的参数。
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>url</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">必须，AJAX请求的方式。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>type</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    "GET"
                
                </td>
            

            <td class="description last">可选，AJAX请求的地址。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>async</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description last">可选，此AJAX请求为异步请求。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>data</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">可选，发送到服务器的数据。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>contentType</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    "application/x-www-form-urlencoded;charset=UTF-8"
                
                </td>
            

            <td class="description last">可选，发送到服务器的数据编码类型。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>dataType</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    "text"
                
                </td>
            

            <td class="description last">可选，预期服务器返回的数据类型。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>timeout</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description last">可选，AJAX请求的超时时间。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>beforeSend</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">可选，请求发送前的回调函数。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>success</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">可选，请求成功后的回调函数。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>error</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">可选，请求失败时调用此函数。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>username</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">可选，用于响应HTTP访问认证请求的用户名。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>password</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">可选，用于响应HTTP访问认证请求的用户密码。</td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line1175">line 1175</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    AJAX对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="AJAX.html">AJAX</a></span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").ajax({    
    url: "localhost/data.json"
    type: "POST",
    data: {
        name: "user"
    },
    success: function(data){
    },
    error: function(){
    }
});</code></pre>



        
            

    

    
    <h4 class="name" id="attr"><span class="type-signature"></span>attr<span class="signature">(attrName<span class="signature-attributes">opt</span>, attrValue<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    被选对象获取或设置属性。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>attrName</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">array</span>
|

<span class="param-type">object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，属性名|属性名数组|属性键值对数组|属性键值对对象。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>attrValue</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，属性值。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line977">line 977</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").attr();</code></pre>

    <pre class="prettyprint"><code>thinjs("div").attr("id");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").attr(["id", "class"]);</code></pre>

    <pre class="prettyprint"><code>thinjs("div").attr([{"id":"myDiv"}, {"class":"active"}]);</code></pre>

    <pre class="prettyprint"><code>thinjs("div").attr({"id":"myDiv", "class":"active"});</code></pre>

    <pre class="prettyprint"><code>thinjs("div").attr("id", "myDiv");</code></pre>



        
            

    

    
    <h4 class="name" id="before"><span class="type-signature"></span>before<span class="signature">(str)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    向被选元素的前面添加内容。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>str</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，需要添加的内容。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line309">line 309</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").before("This is the content added through before.");</code></pre>



        
            

    

    
    <h4 class="name" id="class"><span class="type-signature"></span>class<span class="signature">(className<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    获取或设置被选元素的class或指定class。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>className</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，设置指定class名称。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line710">line 710</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象|class名称。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").class();</code></pre>

    <pre class="prettyprint"><code>thinjs("div").class("active");</code></pre>



        
            

    

    
    <h4 class="name" id="contains"><span class="type-signature"></span>contains<span class="signature">(node)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
    

    



<div class="description">
    判断被选元素是否包含指定的元素。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>node</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">HTMLElement</span>


            
            </td>

            

            

            <td class="description last">必须，元素。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line548">line 548</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    是否包含指定的元素。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").conatins("I am a text.");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").contains("span");</code></pre>



        
            

    

    
    <h4 class="name" id="data"><span class="type-signature"></span>data<span class="signature">(name<span class="signature-attributes">opt</span>, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    在匹配元素上存储任意相关数据，或者查询相关数据。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">array</span>
|

<span class="param-type">object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，用户存储数据的名称|以键值对的形式存储数据。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>value</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，用户存储数据的内容或值。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line1077">line 1077</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").data();</code></pre>

    <pre class="prettyprint"><code>thinjs("div").data("set");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").data({"set":"set value", "config": "config value"});</code></pre>

    <pre class="prettyprint"><code>thinjs("div").data("set", "set value");</code></pre>



        
            

    

    
    <h4 class="name" id="define"><span class="type-signature"></span>define<span class="signature">(name, func)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    扩展自定义函数方法。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">扩展的函数名。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>func</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">扩展的函数体。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line138">line 138</a>
    </li></ul></dd>
    

    

    

    
</dl>



















    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs().define("length", function(){
    return this.elements.length;
});</code></pre>



        
            

    

    
    <h4 class="name" id="each"><span class="type-signature"></span>each<span class="signature">(callback)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    为每一个被选元素执行相同的方法。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">必须，执行的函数。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line377">line 377</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").each(function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="empty"><span class="type-signature"></span>empty<span class="signature">()</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    清空被选元素的内容。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line338">line 338</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").empty();</code></pre>



        
            

    

    
    <h4 class="name" id="eq"><span class="type-signature"></span>eq<span class="signature">(num)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    获取当前匹配到的指定位置的元素，从零起始。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>num</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>


            
            </td>

            

            

            <td class="description last">必须，指定位置。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line207">line 207</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").eq(0);</code></pre>



        
            

    

    
    <h4 class="name" id="filter"><span class="type-signature"></span>filter<span class="signature">(selector)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    过滤符合条件的元素。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>selector</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，过来条件。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line233">line 233</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").ready(".active");</code></pre>



        
            

    

    
    <h4 class="name" id="foreach"><span class="type-signature"></span>foreach<span class="signature">(callback)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    为每一个被选元素执行相同的方法。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">必须，执行的函数。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line390">line 390</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").foreach(function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="forEach"><span class="type-signature"></span>forEach<span class="signature">(callback)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    为每一个被选元素执行相同的方法。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">必须，执行的函数。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line403">line 403</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").forEach(function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="hasAttr"><span class="type-signature"></span>hasAttr<span class="signature">(attr)</span><span class="type-signature"> &rarr; {boolean|array}</span></h4>
    

    



<div class="description">
    判断被选元素是否拥有指定的属性。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>attr</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">array</span>


            
            </td>

            

            

            <td class="description last">必须，属性名称|属性名称数组。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line932">line 932</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    被选对象是否拥有指定的属性。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>
|

<span class="param-type">array</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").hasAttr("class");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").hasAttr(["id", "click"]);</code></pre>



        
            

    

    
    <h4 class="name" id="hasClass"><span class="type-signature"></span>hasClass<span class="signature">(className<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {boolean|array}</span></h4>
    

    



<div class="description">
    判断被选元素是否拥有class或指定的class。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>className</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，class名称。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line643">line 643</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    是否拥有class或指定的class。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>
|

<span class="param-type">array</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").hasClass();</code></pre>

    <pre class="prettyprint"><code>thinjs("div").hasClass("active");</code></pre>



        
            

    

    
    <h4 class="name" id="hide"><span class="type-signature"></span>hide<span class="signature">()</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    隐藏被选元素。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line862">line 862</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").hide();</code></pre>



        
            

    

    
    <h4 class="name" id="html"><span class="type-signature"></span>html<span class="signature">(str<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    获取或设置被选元素的html内容。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>str</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，html字符串。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line249">line 249</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象|被选元素的html内容。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").html();</code></pre>

    <pre class="prettyprint"><code>thinjs("div").html("&lt;span>This is a testing text.&lt;/span>");</code></pre>



        
            

    

    
    <h4 class="name" id="isEmpty"><span class="type-signature"></span>isEmpty<span class="signature">()</span><span class="type-signature"> &rarr; {boolean|array}</span></h4>
    

    



<div class="description">
    判断被选元素是否为空。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line352">line 352</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    被选元素是否为空。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>
|

<span class="param-type">array</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").isEmpty();</code></pre>



        
            

    

    
    <h4 class="name" id="not"><span class="type-signature"></span>not<span class="signature">(selector)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    排除符合条件的元素。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>selector</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，排除条件。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line219">line 219</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").not(".index");</code></pre>



        
            

    

    
    <h4 class="name" id="off"><span class="type-signature"></span>off<span class="signature">(eventName, function<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    向被选元素移除一个或多个事件处理程序。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>eventName</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">必须，要移除的事件名。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>function</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，要移除的方法。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line510">line 510</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").off("click");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").off("click", function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="on"><span class="type-signature"></span>on<span class="signature">(event, childSelector<span class="signature-attributes">opt</span>, callback)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    向被选元素添加一个或多个事件处理程序。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>event</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">必须，事件名，多个则用空格隔开。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>childSelector</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，规定只能添加到指定的子元素上的事件处理程序。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">必须，当事件发生时运行的函数。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line442">line 442</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").on("click", function(){    
});</code></pre>

    <pre class="prettyprint"><code>thinjs("div").on("click", "#myDiv", function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="ready"><span class="type-signature"></span>ready<span class="signature">(element<span class="signature-attributes">opt</span>, callback)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    当文档加载后执行的事件。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>element</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，需要判断为ready状态的元素。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">必须，文档加载后运行的函数。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line170">line 170</a>
    </li></ul></dd>
    

    

    

    
</dl>



















    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs(document).ready(function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="removeAttr"><span class="type-signature"></span>removeAttr<span class="signature">(attr)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    被选元素移除一个或多个指定的属性。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>attr</code></td>
            

            <td class="type">
            
                
<span class="param-type">array</span>
|

<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，属性名|属性名数组。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line904">line 904</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").removeAttr("class");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").removeAttr(["id" ,"click"]);</code></pre>



        
            

    

    
    <h4 class="name" id="removeClass"><span class="type-signature"></span>removeClass<span class="signature">(className)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    为被选元素移除指定class。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>className</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，class名称。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line615">line 615</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").removeClass(".active");</code></pre>



        
            

    

    
    <h4 class="name" id="show"><span class="type-signature"></span>show<span class="signature">()</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    显示被选元素。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line849">line 849</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").show();</code></pre>



        
            

    

    
    <h4 class="name" id="siblings"><span class="type-signature"></span>siblings<span class="signature">()</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    获取被选元素的兄弟元素。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line415">line 415</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div#myDiv").siblings(function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="slice"><span class="type-signature"></span>slice<span class="signature">(start, end<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    从被选元素中，返回选定的元素。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>start</code></td>
            

            <td class="type">
            
                
<span class="param-type">int</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">必须，规定从何处开始选取。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>end</code></td>
            

            <td class="type">
            
                
<span class="param-type">int</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，规定从何处结束选取。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line573">line 573</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").slice(1);</code></pre>

    <pre class="prettyprint"><code>thinjs("div").slice(1, 3);</code></pre>



        
            

    

    
    <h4 class="name" id="style"><span class="type-signature"></span>style<span class="signature">(styleName<span class="signature-attributes">opt</span>, styleContent<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    获取或设置被选元素的应用样式。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>styleName</code></td>
            

            <td class="type">
            
                
<span class="param-type">array</span>
|

<span class="param-type">object</span>
|

<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，样式名称数组|样式键值数组|样式名称。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>styleContent</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，样式内容。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line764">line 764</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象|样式内容。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").style();</code></pre>

    <pre class="prettyprint"><code>thinjs("div").style("height");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").style(["height","width"]);</code></pre>

    <pre class="prettyprint"><code>thinjs("div").style({height:"100px", width:"50px"});</code></pre>

    <pre class="prettyprint"><code>thinjs("div").style([{height:"100px"}, {width:"50px"}]);</code></pre>

    <pre class="prettyprint"><code>thinjs("div").style("height", "100px").width("width", "50px");</code></pre>



        
            

    

    
    <h4 class="name" id="text"><span class="type-signature"></span>text<span class="signature">(str<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    获取或设置被选元素的text内容。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>str</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，text字符串。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line280">line 280</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象|被选元素的text内容。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("span").text();</code></pre>

    <pre class="prettyprint"><code>thinjs("span").text("This is a testing text.");</code></pre>



        
            

    

    
    <h4 class="name" id="toggle"><span class="type-signature"></span>toggle<span class="signature">()</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    切换显示或隐藏被选元素。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line875">line 875</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").toggle();</code></pre>



        
            

    

    
    <h4 class="name" id="toggleClass"><span class="type-signature"></span>toggleClass<span class="signature">(className)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    被选元素切换指定class。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>className</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，class名称。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line692">line 692</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").toggleClass("active");</code></pre>



        
    

    

    
</article>

</section>







<section>

<header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>ThinJS<span class="signature">(selector<span class="signature-attributes">opt</span>, datas<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ThinJS.html">ThinJS</a>}</span></h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    

    
    <h4 class="name" id="ThinJS"><span class="type-signature"></span>new ThinJS<span class="signature">(selector<span class="signature-attributes">opt</span>, datas<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ThinJS.html">ThinJS</a>}</span></h4>
    

    



<div class="description">
    ThinJS构造函数
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>selector</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">NodeList</span>
|

<span class="param-type">HTMLDocument</span>
|

<span class="param-type">Window</span>
|

<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，元素选择器。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>datas</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，定义模板数据对象。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line34">line 34</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="ThinJS.html">ThinJS</a></span>


    </dd>
</dl>

    





    
    </div>

    

    

    

    

    

    

    
        <h3 class="subsection-title">Members</h3>

        
            
<h4 class="name" id="length"><span class="type-signature"></span>length<span class="type-signature"></span></h4>




<div class="description">
    返回匹配元素的数量。
</div>







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line158">line 158</a>
    </li></ul></dd>
    

    

    

    
</dl>





    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").length;</code></pre>



        
            
<h4 class="name" id="version"><span class="type-signature"></span>version<span class="type-signature"></span></h4>




<div class="description">
    返回当前ThinJS库版本。
</div>







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line148">line 148</a>
    </li></ul></dd>
    

    

    

    
</dl>





    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs().version;</code></pre>



        
    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    
    <h4 class="name" id=".main"><span class="type-signature">(static) </span>main<span class="signature">(selector, data<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ThinJS.html">ThinJS</a>}</span></h4>
    

    



<div class="description">
    ThinJS类的实例化方法。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>selector</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Array</span>
|

<span class="param-type">NodeList</span>
|

<span class="param-type">HTMLDocument</span>
|

<span class="param-type">Window</span>
|

<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">必须，元素选择器。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>data</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，定义模板数据对象。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line125">line 125</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="ThinJS.html">ThinJS</a></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="addAttr"><span class="type-signature"></span>addAttr<span class="signature">(attr)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    被选元素设置一个或多个指定的属性。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>attr</code></td>
            

            <td class="type">
            
                
<span class="param-type">array</span>


            
            </td>

            

            

            <td class="description last">必须，属性键值对数组。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line889">line 889</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").addAttr([{"id":"#myDiv"}, {"class":"active"}]);</code></pre>



        
            

    

    
    <h4 class="name" id="addClass"><span class="type-signature"></span>addClass<span class="signature">(className)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    为选取元素添加指定class。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>className</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，class名称。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line587">line 587</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").addClass(".active");</code></pre>



        
            

    

    
    <h4 class="name" id="after"><span class="type-signature"></span>after<span class="signature">(str)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    向被选元素的后面添加内容。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>str</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，需要添加的内容。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line324">line 324</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").after("This is the content added through after.");</code></pre>



        
            

    

    
    <h4 class="name" id="ajax"><span class="type-signature"></span>ajax<span class="signature">(settings)</span><span class="type-signature"> &rarr; {<a href="AJAX.html">AJAX</a>}</span></h4>
    

    



<div class="description">
    AJAX类实例调用方法。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>settings</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last">AJAX请求的参数。
                <h6>Properties</h6>
                

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>url</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">必须，AJAX请求的方式。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>type</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    "GET"
                
                </td>
            

            <td class="description last">可选，AJAX请求的地址。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>async</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    true
                
                </td>
            

            <td class="description last">可选，此AJAX请求为异步请求。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>data</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>
|

<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">可选，发送到服务器的数据。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>contentType</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    "application/x-www-form-urlencoded;charset=UTF-8"
                
                </td>
            

            <td class="description last">可选，发送到服务器的数据编码类型。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>dataType</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    "text"
                
                </td>
            

            <td class="description last">可选，预期服务器返回的数据类型。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>timeout</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    0
                
                </td>
            

            <td class="description last">可选，AJAX请求的超时时间。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>beforeSend</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">可选，请求发送前的回调函数。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>success</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">可选，请求成功后的回调函数。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>error</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">可选，请求失败时调用此函数。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>username</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">可选，用于响应HTTP访问认证请求的用户名。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>password</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last">可选，用于响应HTTP访问认证请求的用户密码。</td>
        </tr>

    
    </tbody>
</table>

            </td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line1175">line 1175</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    AJAX对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="AJAX.html">AJAX</a></span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").ajax({    
    url: "localhost/data.json"
    type: "POST",
    data: {
        name: "user"
    },
    success: function(data){
    },
    error: function(){
    }
});</code></pre>



        
            

    

    
    <h4 class="name" id="attr"><span class="type-signature"></span>attr<span class="signature">(attrName<span class="signature-attributes">opt</span>, attrValue<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    被选对象获取或设置属性。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>attrName</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">array</span>
|

<span class="param-type">object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，属性名|属性名数组|属性键值对数组|属性键值对对象。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>attrValue</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，属性值。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line977">line 977</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").attr();</code></pre>

    <pre class="prettyprint"><code>thinjs("div").attr("id");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").attr(["id", "class"]);</code></pre>

    <pre class="prettyprint"><code>thinjs("div").attr([{"id":"myDiv"}, {"class":"active"}]);</code></pre>

    <pre class="prettyprint"><code>thinjs("div").attr({"id":"myDiv", "class":"active"});</code></pre>

    <pre class="prettyprint"><code>thinjs("div").attr("id", "myDiv");</code></pre>



        
            

    

    
    <h4 class="name" id="before"><span class="type-signature"></span>before<span class="signature">(str)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    向被选元素的前面添加内容。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>str</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，需要添加的内容。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line309">line 309</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").before("This is the content added through before.");</code></pre>



        
            

    

    
    <h4 class="name" id="class"><span class="type-signature"></span>class<span class="signature">(className<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    获取或设置被选元素的class或指定class。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>className</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，设置指定class名称。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line710">line 710</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象|class名称。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").class();</code></pre>

    <pre class="prettyprint"><code>thinjs("div").class("active");</code></pre>



        
            

    

    
    <h4 class="name" id="contains"><span class="type-signature"></span>contains<span class="signature">(node)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
    

    



<div class="description">
    判断被选元素是否包含指定的元素。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>node</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">HTMLElement</span>


            
            </td>

            

            

            <td class="description last">必须，元素。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line548">line 548</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    是否包含指定的元素。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").conatins("I am a text.");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").contains("span");</code></pre>



        
            

    

    
    <h4 class="name" id="data"><span class="type-signature"></span>data<span class="signature">(name<span class="signature-attributes">opt</span>, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    在匹配元素上存储任意相关数据，或者查询相关数据。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">array</span>
|

<span class="param-type">object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，用户存储数据的名称|以键值对的形式存储数据。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>value</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，用户存储数据的内容或值。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line1077">line 1077</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").data();</code></pre>

    <pre class="prettyprint"><code>thinjs("div").data("set");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").data({"set":"set value", "config": "config value"});</code></pre>

    <pre class="prettyprint"><code>thinjs("div").data("set", "set value");</code></pre>



        
            

    

    
    <h4 class="name" id="define"><span class="type-signature"></span>define<span class="signature">(name, func)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    扩展自定义函数方法。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">扩展的函数名。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>func</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">扩展的函数体。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line138">line 138</a>
    </li></ul></dd>
    

    

    

    
</dl>



















    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs().define("length", function(){
    return this.elements.length;
});</code></pre>



        
            

    

    
    <h4 class="name" id="each"><span class="type-signature"></span>each<span class="signature">(callback)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    为每一个被选元素执行相同的方法。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">必须，执行的函数。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line377">line 377</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").each(function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="empty"><span class="type-signature"></span>empty<span class="signature">()</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    清空被选元素的内容。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line338">line 338</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").empty();</code></pre>



        
            

    

    
    <h4 class="name" id="eq"><span class="type-signature"></span>eq<span class="signature">(num)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    获取当前匹配到的指定位置的元素，从零起始。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>num</code></td>
            

            <td class="type">
            
                
<span class="param-type">integer</span>


            
            </td>

            

            

            <td class="description last">必须，指定位置。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line207">line 207</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").eq(0);</code></pre>



        
            

    

    
    <h4 class="name" id="filter"><span class="type-signature"></span>filter<span class="signature">(selector)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    过滤符合条件的元素。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>selector</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，过来条件。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line233">line 233</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").ready(".active");</code></pre>



        
            

    

    
    <h4 class="name" id="foreach"><span class="type-signature"></span>foreach<span class="signature">(callback)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    为每一个被选元素执行相同的方法。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">必须，执行的函数。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line390">line 390</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").foreach(function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="forEach"><span class="type-signature"></span>forEach<span class="signature">(callback)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    为每一个被选元素执行相同的方法。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">必须，执行的函数。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line403">line 403</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").forEach(function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="hasAttr"><span class="type-signature"></span>hasAttr<span class="signature">(attr)</span><span class="type-signature"> &rarr; {boolean|array}</span></h4>
    

    



<div class="description">
    判断被选元素是否拥有指定的属性。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>attr</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">array</span>


            
            </td>

            

            

            <td class="description last">必须，属性名称|属性名称数组。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line932">line 932</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    被选对象是否拥有指定的属性。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>
|

<span class="param-type">array</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").hasAttr("class");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").hasAttr(["id", "click"]);</code></pre>



        
            

    

    
    <h4 class="name" id="hasClass"><span class="type-signature"></span>hasClass<span class="signature">(className<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {boolean|array}</span></h4>
    

    



<div class="description">
    判断被选元素是否拥有class或指定的class。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>className</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，class名称。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line643">line 643</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    是否拥有class或指定的class。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>
|

<span class="param-type">array</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").hasClass();</code></pre>

    <pre class="prettyprint"><code>thinjs("div").hasClass("active");</code></pre>



        
            

    

    
    <h4 class="name" id="hide"><span class="type-signature"></span>hide<span class="signature">()</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    隐藏被选元素。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line862">line 862</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").hide();</code></pre>



        
            

    

    
    <h4 class="name" id="html"><span class="type-signature"></span>html<span class="signature">(str<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    获取或设置被选元素的html内容。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>str</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，html字符串。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line249">line 249</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象|被选元素的html内容。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").html();</code></pre>

    <pre class="prettyprint"><code>thinjs("div").html("&lt;span>This is a testing text.&lt;/span>");</code></pre>



        
            

    

    
    <h4 class="name" id="isEmpty"><span class="type-signature"></span>isEmpty<span class="signature">()</span><span class="type-signature"> &rarr; {boolean|array}</span></h4>
    

    



<div class="description">
    判断被选元素是否为空。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line352">line 352</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    被选元素是否为空。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>
|

<span class="param-type">array</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").isEmpty();</code></pre>



        
            

    

    
    <h4 class="name" id="not"><span class="type-signature"></span>not<span class="signature">(selector)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    排除符合条件的元素。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>selector</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，排除条件。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line219">line 219</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").not(".index");</code></pre>



        
            

    

    
    <h4 class="name" id="off"><span class="type-signature"></span>off<span class="signature">(eventName, function<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    向被选元素移除一个或多个事件处理程序。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>eventName</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">必须，要移除的事件名。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>function</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，要移除的方法。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line510">line 510</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").off("click");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").off("click", function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="on"><span class="type-signature"></span>on<span class="signature">(event, childSelector<span class="signature-attributes">opt</span>, callback)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    向被选元素添加一个或多个事件处理程序。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>event</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">必须，事件名，多个则用空格隔开。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>childSelector</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，规定只能添加到指定的子元素上的事件处理程序。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">必须，当事件发生时运行的函数。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line442">line 442</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").on("click", function(){    
});</code></pre>

    <pre class="prettyprint"><code>thinjs("div").on("click", "#myDiv", function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="ready"><span class="type-signature"></span>ready<span class="signature">(element<span class="signature-attributes">opt</span>, callback)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    当文档加载后执行的事件。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>element</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，需要判断为ready状态的元素。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">必须，文档加载后运行的函数。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line170">line 170</a>
    </li></ul></dd>
    

    

    

    
</dl>



















    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs(document).ready(function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="removeAttr"><span class="type-signature"></span>removeAttr<span class="signature">(attr)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    被选元素移除一个或多个指定的属性。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>attr</code></td>
            

            <td class="type">
            
                
<span class="param-type">array</span>
|

<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，属性名|属性名数组。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line904">line 904</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").removeAttr("class");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").removeAttr(["id" ,"click"]);</code></pre>



        
            

    

    
    <h4 class="name" id="removeClass"><span class="type-signature"></span>removeClass<span class="signature">(className)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    为被选元素移除指定class。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>className</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，class名称。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line615">line 615</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").removeClass(".active");</code></pre>



        
            

    

    
    <h4 class="name" id="show"><span class="type-signature"></span>show<span class="signature">()</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    显示被选元素。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line849">line 849</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").show();</code></pre>



        
            

    

    
    <h4 class="name" id="siblings"><span class="type-signature"></span>siblings<span class="signature">()</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    获取被选元素的兄弟元素。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line415">line 415</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div#myDiv").siblings(function(){    
});</code></pre>



        
            

    

    
    <h4 class="name" id="slice"><span class="type-signature"></span>slice<span class="signature">(start, end<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    从被选元素中，返回选定的元素。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>start</code></td>
            

            <td class="type">
            
                
<span class="param-type">int</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">必须，规定从何处开始选取。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>end</code></td>
            

            <td class="type">
            
                
<span class="param-type">int</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，规定从何处结束选取。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line573">line 573</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").slice(1);</code></pre>

    <pre class="prettyprint"><code>thinjs("div").slice(1, 3);</code></pre>



        
            

    

    
    <h4 class="name" id="style"><span class="type-signature"></span>style<span class="signature">(styleName<span class="signature-attributes">opt</span>, styleContent<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    获取或设置被选元素的应用样式。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>styleName</code></td>
            

            <td class="type">
            
                
<span class="param-type">array</span>
|

<span class="param-type">object</span>
|

<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，样式名称数组|样式键值数组|样式名称。</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>styleContent</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，样式内容。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line764">line 764</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象|样式内容。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("div").style();</code></pre>

    <pre class="prettyprint"><code>thinjs("div").style("height");</code></pre>

    <pre class="prettyprint"><code>thinjs("div").style(["height","width"]);</code></pre>

    <pre class="prettyprint"><code>thinjs("div").style({height:"100px", width:"50px"});</code></pre>

    <pre class="prettyprint"><code>thinjs("div").style([{height:"100px"}, {width:"50px"}]);</code></pre>

    <pre class="prettyprint"><code>thinjs("div").style("height", "100px").width("width", "50px");</code></pre>



        
            

    

    
    <h4 class="name" id="text"><span class="type-signature"></span>text<span class="signature">(str<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    获取或设置被选元素的text内容。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>str</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">可选，text字符串。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line280">line 280</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象|被选元素的text内容。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>thinjs("span").text();</code></pre>

    <pre class="prettyprint"><code>thinjs("span").text("This is a testing text.");</code></pre>



        
            

    

    
    <h4 class="name" id="toggle"><span class="type-signature"></span>toggle<span class="signature">()</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    切换显示或隐藏被选元素。
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line875">line 875</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").toggle();</code></pre>



        
            

    

    
    <h4 class="name" id="toggleClass"><span class="type-signature"></span>toggleClass<span class="signature">(className)</span><span class="type-signature"> &rarr; {mixed}</span></h4>
    

    



<div class="description">
    被选元素切换指定class。
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>className</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">必须，class名称。</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="thinjs.js.html">thinjs.js</a>, <a href="thinjs.js.html#line692">line 692</a>
    </li></ul></dd>
    

    

    

    
</dl>















<h5>Returns:</h5>

        
<div class="param-desc">
    ThinJS对象。
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">mixed</span>


    </dd>
</dl>

    




    <h5>Example</h5>
    
    <pre class="prettyprint"><code>thinjs("div").toggleClass("active");</code></pre>



        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AJAX.html">AJAX</a></li><li><a href="ThinJS.html">ThinJS</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Wed Apr 08 2020 13:48:00 GMT+0800 (GMT+08:00)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>